'use strict';
let express = require('express');
let router = express.Router();
let fs=require('fs');
let url = require('url');
let server = require('./api');
let title="聚合教育";
let data="123456";
// server.API.ajax({
// 	url:'/website',
// 	data:{"is_full":1},
// 	type:"get",
// 	success:function(data){
// 		data=JSON.stringify(data.data)
// 	}
//  })	

router.get('*', function(req, res, next) {
	var URL=url.parse(req.url);
	var path=URL.pathname;
	var res=res;
	switch(path)
	{
		case '/':
			res.render('index', {
				title:title
			});

		  	 break; 
		 case '/index':
			  res.render('index', {
				title:title
			  });
			  break;
		default:
		  res.render(path.substring(1),{
		  	title:title
		  });
		  break;
	}
  
});

module.exports = router;
